package com.shirotest.shiro;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.SimpleCredentialsMatcher;

/**
 * 自定义密码校验器
 */
public class MyCredentialsMatcher extends SimpleCredentialsMatcher {
	@Override
	public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
		String originalPassword = new String((char[])token.getCredentials());
		String sqlOriginalPassword = (String)info.getCredentials();
		return originalPassword.equals(sqlOriginalPassword);
	}
}
